﻿<%@ Page Title="Items Admininstration" Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true"
    CodeBehind="Items.aspx.cs" Inherits="KorleBu.Items" %>

<%@ Register TagPrefix="asp" Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style1
        {
            width: 97px;
        }
        
        .cssPager td
        {
            padding-left: 4px;
            padding-right: 4px;
            text-decoration: underline;
        }
        
        .style3
        {
            width: 136px;
        }
        .style4
        {
            width: 129px;
        }
        .style5
        {
            width: 112px;
        }
        
    </style>
</asp:Content>
<%--<asp:Content ID="Content3" ContentPlaceHolderID="errorContentPlaceholder" runat="server">
</asp:Content>--%>
<asp:Content ID="Content4" ContentPlaceHolderID="sidebarcontentplaceholder" runat="server">
    <p>
        <br />
        <asp:Label ID="lblLoggedInUser" runat="server" Font-Bold="true" Visible="true" />
    </p>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="maincontentplaceholder" runat="server">
    <asp:ScriptManager ID="ScriptManager" runat="server" />
    <br />
    <asp:UpdatePanel ID="UpdatePanel" runat="server">
        <ContentTemplate>
            <div id="ebar">
                <asp:Label runat="server" ID="lblMasterError" CssClass="errorLabel" />
            </div>
            <asp:TabContainer ID="TabContainer1" runat="server" AutoPostBack="true" ActiveTabIndex="4"
                Width="100%" OnActiveTabChanged="TabContainer_ActiveTabChanged">
                <asp:TabPanel ID="TabPanel1" runat="server" HeaderText="TabPanel1">
                    <HeaderTemplate>
                        Add Item
                    </HeaderTemplate>
                    <ContentTemplate>
                        <br />
                        <fieldset style="width: 573px; height: auto;">
                            <legend>Add Item</legend>
                            <table>
                                <tr>
                                    <th>
                                        <asp:Label ID="lblItemName" Width="120px" CssClass="labels" runat="server">Item Name:</asp:Label>
                                    </th>
                                    <td>
                                        <asp:TextBox ID="txtItemName" runat="server" MaxLength="99"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtItemName"
                                            ErrorMessage="Item name is required" ForeColor="Red" ValidationGroup="addItem">*</asp:RequiredFieldValidator>
                                    </td>
                                    <td rowspan="7">
                                        <asp:ValidationSummary ID="vsaddItem" runat="server" ForeColor="Red" ValidationGroup="addItem" />
                                    </td>
                                </tr>
                                <tr>
                                    <th>
                                        <asp:Label ID="lblItemCategory" CssClass="labels" Width="120px" runat="server">Item Category:</asp:Label>
                                    </th>
                                    <td>
                                        <asp:DropDownList ID="ddlItemCategory" runat="server" >
                                        </asp:DropDownList>
                                    </td>
                                </tr>
                                <tr>
                                    <th>
                                        <asp:Label ID="lblItemUnit" CssClass="labels" Width="120px" runat="server">Item Unit:</asp:Label>
                                    </th>
                                    <td>
                                        <asp:DropDownList ID="ddlItemUnit" runat="server" AutoPostBack="True">
                                        </asp:DropDownList>
                                    </td>
                                </tr>
                                <tr>
                                    <th>
                                        <asp:Label ID="Label7" CssClass="labels" Width="120px" runat="server">Vendor Cost:</asp:Label>
                                    </th>
                                    <td>
                                        <asp:TextBox ID="txtAddItemVendorCost" runat="server" MaxLength="10" Width="120px"></asp:TextBox>
                                        <asp:RegularExpressionValidator ID="revVendorCost" runat="server" ControlToValidate="txtAddItemVendorCost"
                                            ErrorMessage="Please enter a money value" ForeColor="Red" ValidationExpression="^[0-9]+(\.)?[0-9]?[0-9]?$"
                                            ValidationGroup="addItem">*</asp:RegularExpressionValidator>
                                        <asp:RequiredFieldValidator ID="rfvVendorCost" runat="server" ControlToValidate="txtAddItemVendorCost"
                                            ErrorMessage="Markup cost is required" ForeColor="Red" ValidationGroup="addItem">*</asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <th>
                                        <asp:Label ID="Label8" CssClass="labels" Width="120px" runat="server">Markup Percent:</asp:Label>
                                    </th>
                                    <td>
                                        <asp:TextBox ID="txtMarkupPercent" runat="server" MaxLength="10" Width="120px">15</asp:TextBox>
                                        <asp:RequiredFieldValidator ID="rfvMarkupPercent" runat="server" ControlToValidate="txtMarkupPercent"
                                            ErrorMessage="Markup percent is required" ForeColor="Red" ValidationGroup="addItem">*</asp:RequiredFieldValidator>
                                        <asp:RangeValidator ID="rvMarkupPercent" runat="server" ErrorMessage="Must be a number 0 - 100"
                                            ControlToValidate="txtMarkupPercent" ForeColor="Red" ValidationGroup="addItem" 
                                            Type="Integer" MaximumValue="100" MinimumValue="0">*</asp:RangeValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <th>
                                        <asp:Label Text="Emergency Quantity:" CssClass="labels" Width="120px" runat="server" ID="lblEmergencyQuantity" />
                                    </th>
                                    <td>
                                        <asp:TextBox ID="txtEmergencyQuantity" runat="server" MaxLength="5" Width="50px"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="rfvEmergencyQuantity" runat="server" ControlToValidate="txtEmergencyQuantity"
                                            ErrorMessage="Emergency Quantity Required" ForeColor="Red" ValidationGroup="addItem" Display="Dynamic">*</asp:RequiredFieldValidator>
                                        <asp:CompareValidator ID="cvEmergencyQuantity" runat="server" ControlToValidate="txtEmergencyQuantity"
                                            ErrorMessage="Quantity cannot be negative" ForeColor="Red" Type="Integer" Operator="GreaterThanEqual"
                                            ValidationGroup="addItem" ValueToCompare="0" Display="Dynamic">*</asp:CompareValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <th>
                                        <asp:Label Text="Restock Quantity:" CssClass="labels" Width="120px" runat="server" ID="Label2" />
                                    </th>
                                    <td>
                                        <asp:TextBox ID="txtAddItemMinStock" runat="server" MaxLength="5" Width="50px"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtEmergencyQuantity"
                                            ErrorMessage="Restock Quantity Required" ForeColor="Red" ValidationGroup="addItem" Display="Dynamic">*</asp:RequiredFieldValidator>
                                        <asp:CompareValidator ID="cvAddItemMinStock" runat="server" ControlToValidate="txtAddItemMinStock"
                                            ErrorMessage="Quantity cannot be negative" ForeColor="Red" Type="Integer" Operator="GreaterThanEqual"
                                            ValidationGroup="addItem" ValueToCompare="0" Display="Dynamic">*</asp:CompareValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <th>
                                        <asp:Label ID="Label9" CssClass="labels" Width="120px" runat="server" Text="Vendor:"></asp:Label>
                                    </th>
                                    <td>
                                        <asp:DropDownList ID="ddlSelectedVendor" runat="server">
                                        </asp:DropDownList>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label runat="server" ID="lblActiveStatus" Width="120px" Text="Status:"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:RadioButtonList RepeatDirection="Horizontal" runat="server" ID="radActiveStatus">
                                            <asp:ListItem Text="Active" Value="10" Selected="True" />
                                            <asp:ListItem Text="Inactive" Value="11" />
                                        </asp:RadioButtonList>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="3">
                                        <asp:Button ID="btnAddItem" runat="server" Text="Add Item" Width="74px" OnClick="btnAddItem_Click"
                                            ValidationGroup="addItem" />
                                    </td>
                                </tr>
                            </table>
                        </fieldset>
                        <br />
                        <br />
                        <asp:Label ID="lblCreateSuccess" runat="server" Font-Bold="True" ForeColor="Green" BackColor="#CFE2C6"></asp:Label>
                        <asp:Label runat="server" ID="lblCreateError" CssClass="errorLabel" />
                    </ContentTemplate>
                </asp:TabPanel>
                <asp:TabPanel ID="TabPanel2" runat="server" HeaderText="TabPanel2">
                    <HeaderTemplate>
                        Modify Item</HeaderTemplate>
                    <ContentTemplate>
                        <%-- Modify Item stuff starts here. Wrap in div so as to hide the stuff and provide a way back to the search view. --%>
                        <asp:Panel runat="server" ID="pnlModifySearch">
                            <fieldset style="width: 537px">
                                <legend>Search Items</legend>
                                <table style="width: 100%;">
                                    <tr>
                                        <th class="style1">
                                            <asp:Label ID="lblItemCategory2" Width="102px" runat="server" Text="Item Category:"></asp:Label>
                                        </th>
                                        <td class="style3">
                                            <asp:DropDownList ID="ddlItemCategory2" runat="server" AutoPostBack="True">
                                            </asp:DropDownList>
                                        </td>
                                        <td rowspan="4">
                                            <asp:ValidationSummary ID="ValidationSummary1" runat="server" ForeColor="Red" />
                                        </td>
                                        <td class="style1">
                                            <asp:Button ID="btnSearch" runat="server" OnClick="btnSearch_Click" Text="Search" />
                                        </td>
                                        <td class="style3">
                                            &nbsp;
                                        </td>
                                    </tr>
                                    <tr>
                                        <th class="style1">
                                            <asp:Label ID="lblItemName2" Width="102px" runat="server" Text="Item Name:"></asp:Label>
                                        </th>
                                        <td class="style3">
                                            <asp:TextBox ID="txtItemName2" runat="server" MaxLength="99"></asp:TextBox>
                                        </td>
                                        <td class="style1">
                                            <asp:Button ID="btnSearchItemName" runat="server" OnClick="btnSearchItemName_Click"
                                                Text="Search" />
                                        </td>
                                        <td class="style3">
                                            <asp:Label ID="lblMyError" runat="server" Font-Bold="True" ForeColor="Red"></asp:Label>
                                        </td>
                                    </tr>
                                </table>
                            </fieldset>
                            <br />
                            <br />
                            <%--<asp:GridView ID="gvModifyItem" runat="server" Width="500px" OnRowCancelingEdit="gvModifyItem_RowCancelingEdit"
                                OnRowEditing="gvModifyItem_RowEditing" AutoGenerateColumns="False" OnRowUpdating="gvModifyItem_RowUpdating"
                                OnRowDataBound="gvModifyItem_RowDataBound" AllowPaging="True" EnableSortingAndPagingCallbacks="True"
                                OnPageIndexChanging="gvModifyItem_PageIndexChanging" PageSize="5"
                                allowSorting="True" OnSorting="gvModifyItem_Sorting">--%>
                                <asp:GridView ID="gvModifyItem" runat="server" Width="500px"
                                AutoGenerateColumns="False" OnRowDataBound="gvModifyItem_RowDataBound" AllowPaging="True"
                                EnableSortingAndPagingCallbacks="True"
                                OnPageIndexChanging="gvModifyItem_PageIndexChanging" PageSize="5"
                                allowSorting="True" OnSorting="gvModifyItem_Sorting" OnRowCommand="gvModifyItem_RowCommand">
                                <RowStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                <Columns>
                                    <asp:ButtonField CommandName="ItemEdit" Text="Edit" ButtonType="Button" />
                                    <%--<asp:TemplateField HeaderText="ID">
                                        <EditItemTemplate>
                                            <asp:Label ID="lblEditID" runat="server" Text='<%# Eval("itemID") %>'></asp:Label>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="lblItemID" runat="server" Text='<%# Bind("itemID") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>--%>
                                    <asp:TemplateField HeaderText="Name" SortExpression="itemName">
                                        <%--<EditItemTemplate>
                                            <asp:TextBox ID="txtEditName" runat="server" Height="24px" Text='<%# Bind("itemName") %>'
                                                Width="107px" MaxLength="99"></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="rfvModifyItem" runat="server" ControlToValidate="txtEditName"
                                                ErrorMessage="Name is required" ForeColor="Red" Display="Dynamic">*</asp:RequiredFieldValidator>
                                        </EditItemTemplate>--%>
                                        <ItemTemplate>
                                            <asp:Label ID="lblItemName" runat="server" Text='<%# Bind("itemName") %>'></asp:Label>
                                            <asp:Label ID="lblItemID" runat="server" Text='<%# Bind("itemID") %>' Visible="false"></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Cost<br />GH¢">
                                        <%--<EditItemTemplate>
                                            <asp:TextBox ID="txtEditCost" runat="server" Height="22px" Text='<%# Bind("markupCost") %>'
                                                Width="65px" MaxLength="10"></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="rfvEditCost" runat="server" ControlToValidate="txtEditCost"
                                                ErrorMessage="A markup cost is required" ForeColor="Red" Display="Dynamic">*</asp:RequiredFieldValidator>
                                            <asp:RegularExpressionValidator ID="revEditCost" runat="server" ControlToValidate="txtEditCost"
                                                ErrorMessage="Please enter a money value" ForeColor="Red" ValidationExpression="^[0-9]+(\.)?[0-9]?[0-9]?$"
                                                Display="Dynamic">*</asp:RegularExpressionValidator>
                                        </EditItemTemplate>--%>
                                        <ItemTemplate>
                                            <asp:Label ID="lblEditCost" runat="server" Text='<%# Bind("markupCost", "{0:0.00}") %>'></asp:Label>
                                        </ItemTemplate>
                                        <ItemStyle Width="20%" />
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Category">
                                        <%--<EditItemTemplate>
                                            <asp:DropDownList ID="ddlEditCategoryID" runat="server">
                                            </asp:DropDownList>
                                        </EditItemTemplate>--%>
                                        <ItemTemplate>
                                            <asp:Label Visible="false" ID="lblCategoryID" runat="server" Text='<%# Bind("itemCategoryID") %>'></asp:Label>
                                            <asp:Label runat="server" ID="lblCategoryName" Text='<%# Bind("ItemCategoryName") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Store">
                                        <%--<EditItemTemplate>
                                            <asp:DropDownList ID="ddlSelectingStore" runat="server">
                                            </asp:DropDownList>
                                        </EditItemTemplate>--%>
                                        <ItemTemplate>
                                            <asp:Label Visible="false" ID="lblStore" runat="server" Text='<%# Bind("StoreID") %>'></asp:Label>
                                            <asp:Label ID="lblStoreName" runat="server" Text='<%# Bind("StoreName") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                                <%--<EditRowStyle Width="600px" />--%>
                                <PagerStyle CssClass="cssPager" />
                                <PagerSettings Mode="NextPreviousFirstLast" NextPageText="Next" FirstPageText="First"
                                    LastPageText="Last" PreviousPageText="Previous" />
                            </asp:GridView>
                        </asp:Panel>
                        <%-- End of Search panel. --%>
                        <%-- Start of Modify Action panel. Provide a way back to the search panel. IE, Cancel or Commit/Save buttons. --%>
                        <asp:Panel runat="server" ID="pnlModifyAction" Visible="false">
                            <br />
                            <fieldset style="width: 573px; height:auto;">
                                <legend>Modify Item</legend>
                                <table>
                                    <tr>
                                        <th>
                                            <asp:Label runat="server" ID="lblModifyItemID" Visible="false"></asp:Label>
                                            <asp:Label ID="lblModifyItemName" Width="120px" CssClass="labels" runat="server">Item Name:</asp:Label>
                                        </th>
                                        <td>
                                            <asp:TextBox ID="txtModifyItemName" runat="server" MaxLength="99"></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="rfvModifyItemName" runat="server" ControlToValidate="txtModifyItemName"
                                                ErrorMessage="Item name is required" ForeColor="Red" ValidationGroup="modifyItem">*</asp:RequiredFieldValidator>
                                        </td>
                                        <td rowspan="7">
                                            <asp:ValidationSummary ID="vsModifyItem" runat="server" ForeColor="Red" ValidationGroup="modifyItem" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <th>
                                            <asp:Label ID="lblModifyItemCategory" CssClass="labels" Width="120px" runat="server">Item Category:</asp:Label>
                                        </th>
                                        <td>
                                            <asp:DropDownList ID="ddlModifyItemCategory" runat="server" >
                                            </asp:DropDownList>
                                        </td>
                                    </tr>
                                    <tr>
                                        <th>
                                            <asp:Label ID="lblModifyItemUnit" CssClass="labels" Width="120px" runat="server">Item Unit:</asp:Label>
                                        </th>
                                        <td>
                                            <asp:DropDownList ID="ddlModifyItemUnit" runat="server" AutoPostBack="True">
                                            </asp:DropDownList>
                                        </td>
                                    </tr>
                                    <tr>
                                        <th>
                                            <asp:Label ID="lblModifyVendorCost" CssClass="labels" Width="120px" runat="server">Vendor Cost:</asp:Label>
                                        </th>
                                        <td>
                                            <asp:TextBox ID="txtModifyItemVendorCost" runat="server" MaxLength="10" Width="120px"></asp:TextBox>
                                            <asp:RegularExpressionValidator ID="revModifyItemVendorCost" runat="server" ControlToValidate="txtModifyItemVendorCost"
                                                ErrorMessage="Please enter a money value" ForeColor="Red" ValidationExpression="^[0-9]+(\.)?[0-9]?[0-9]?$"
                                                ValidationGroup="modifyItem">*</asp:RegularExpressionValidator>
                                            <asp:RequiredFieldValidator ID="rfvModifyItemVendorCost" runat="server" ControlToValidate="txtModifyItemVendorCost"
                                                ErrorMessage="Markup cost is required" ForeColor="Red" ValidationGroup="modifyItem">*</asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <th>
                                            <asp:Label ID="lblModifyMarkup" CssClass="labels" Width="120px" runat="server">Markup Percent:</asp:Label>
                                        </th>
                                        <td>
                                            <asp:TextBox ID="txtModifyMarkupPercent" runat="server" MaxLength="10" Width="120px">15</asp:TextBox>
                                            <asp:RequiredFieldValidator ID="rfvModifyMarkupPercent" runat="server" ControlToValidate="txtModifyMarkupPercent"
                                                ErrorMessage="Markup percent is required" ForeColor="Red" ValidationGroup="modifyItem">*</asp:RequiredFieldValidator>
                                            <asp:RangeValidator ID="rvModifyMarkupPercent" runat="server" ErrorMessage="Must be a number 0 - 100"
                                                ControlToValidate="txtModifyMarkupPercent" ForeColor="Red" ValidationGroup="modifyItem" 
                                                Type="Integer" MaximumValue="100" MinimumValue="0">*</asp:RangeValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <th>
                                            <asp:Label Text="Emergency Quantity:" CssClass="labels" Width="120px" runat="server" ID="lblModifyEmergencyQty" />
                                        </th>
                                        <td>
                                            <asp:TextBox ID="txtModifyEmergencyQuantity" runat="server" MaxLength="5" Width="50px"></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="rfvModifyEmergencyQuantity" runat="server" ControlToValidate="txtModifyEmergencyQuantity"
                                                ErrorMessage="Emergency Quantity Required" ForeColor="Red" ValidationGroup="modifyItem" Display="Dynamic">*</asp:RequiredFieldValidator>
                                            <asp:CompareValidator ID="cvModifyEmergencyQuantity" runat="server" ControlToValidate="txtModifyEmergencyQuantity"
                                                ErrorMessage="Quantity cannot be negative" ForeColor="Red" Type="Integer" Operator="GreaterThanEqual"
                                                ValidationGroup="modifyItem" ValueToCompare="0" Display="Dynamic">*</asp:CompareValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <th>
                                            <asp:Label Text="Restock Quantity:" CssClass="labels" Width="120px" runat="server" ID="Label6" />
                                        </th>
                                        <td>
                                            <asp:TextBox ID="txtModItemMinStock" runat="server" MaxLength="5" Width="50px"></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="rfvModItemMinStock" runat="server" ControlToValidate="txtModItemMinStock"
                                                ErrorMessage="Restock Quantity Required" ForeColor="Red" ValidationGroup="modifyItem" Display="Dynamic">*</asp:RequiredFieldValidator>
                                            <asp:CompareValidator ID="cvModItemMinStock" runat="server" ControlToValidate="txtModItemMinStock"
                                                ErrorMessage="Quantity cannot be negative" ForeColor="Red" Type="Integer" Operator="GreaterThanEqual"
                                                ValidationGroup="modifyItem" ValueToCompare="0" Display="Dynamic">*</asp:CompareValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <th>
                                            <asp:Label ID="lblModifyVendor" CssClass="labels" Width="120px" runat="server" Text="Vendor:"></asp:Label>
                                        </th>
                                        <td>
                                            <asp:DropDownList ID="ddlModifySelectedVendor" runat="server">
                                            </asp:DropDownList>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label runat="server" ID="lblModifyActiveStatus" Width="120px" Text="Status:"></asp:Label>
                                        </td>
                                        <td>
                                            <asp:RadioButtonList RepeatDirection="Horizontal" runat="server" ID="radModifyActiveStatus">
                                                <asp:ListItem Text="Active" Value="10" />
                                                <asp:ListItem Text="Inactive" Value="11" />
                                            </asp:RadioButtonList>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="3">
                                            <asp:Button ID="btnCommitModifyItem" runat="server" Text="Save Item Modifcation" OnClick="btnCommitModifyItem_Click"
                                                ValidationGroup="modifyItem" />
                                            <asp:Button ID="btnReturnToSearch" runat="server" Text="Return to Item Search" OnClick="btnReturnToSearch_Click" />
                                        </td>
                                    </tr>
                                </table>
                            </fieldset>
                            <br />
                            <br />
                            <asp:Label ID="lblModifySuccess" runat="server" Font-Bold="True" ForeColor="Green" BackColor="#CFE2C6"></asp:Label>
                            <asp:Label runat="server" ID="lblModifyError" CssClass="errorLabel" />
                        </asp:Panel>
                    </ContentTemplate>
                </asp:TabPanel>
                <asp:TabPanel runat="server" HeaderText="TabPanel3" ID="TabPanel3" ScrollBars="Auto">
                    <HeaderTemplate>
                        Add Vendor</HeaderTemplate>
                    <ContentTemplate>
                        <asp:Label ID="lblCVendorSuccess" runat="server" Font-Bold="True" ForeColor="Green" BackColor="#CFE2C6"></asp:Label>
                        <br />
                        <asp:Label ID="lblCVendorError" runat="server" Font-Bold="True" ForeColor="Red"></asp:Label>
                        <br />
                        <fieldset>
                            <legend>Add Vendor</legend>
                            <fieldset style="margin: 5px;">
                                <legend>Vendor Info</legend>
                                <asp:Label ID="lblCVendorName" CssClass="labels" Width="60px" Font-Bold="true" Font-Size="12px" Text="Name:" runat="server" />
                                <asp:TextBox ID="txtCVendorName" runat="server" MaxLength="50" />
                                <br />
                                <asp:Label ID="lblCVendorAddress" CssClass="labels" Width="60px" Font-Bold="true" Font-Size="12px" Text="Address:" runat="server" />
                                <asp:TextBox ID="txtCVendorAddress" runat="server" MaxLength="50" />
                                <br />
                                <asp:Label ID="lblCVendorPhone" CssClass="labels" Width="60px" Font-Bold="true" Font-Size="12px" Text="Phone:" runat="server" />
                                <asp:TextBox ID="txtCVendorPhone" runat="server" MaxLength="25" />
                            </fieldset>
                            <asp:Button ID="btnSave" runat="server" Text="Save" OnClick="btnSave_Click" />
                            <br />
                        </fieldset>
                    </ContentTemplate>
                </asp:TabPanel>
                <asp:TabPanel runat="server" HeaderText="TabPanel4" ID="TabPanel4" ScrollBars="Auto">
                    <HeaderTemplate>
                        Modify Vendor</HeaderTemplate>
                    <ContentTemplate>
                        <asp:Label ID="lblMVendorSuccess" runat="server" Font-Bold="True" ForeColor="Green" BackColor="#CFE2C6"></asp:Label>
                        <br />
                        <asp:Label ID="lblMVendorError" runat="server" Font-Bold="True" ForeColor="Red"></asp:Label>
                        <br />
                        <fieldset>
                            <legend>Modify Vendor</legend>
                            <asp:Label ID="lblSelectVendor" CssClass="labels" Width="100px" Font-Bold="true" Font-Size="12px" runat="server" Text="Select Vendor:"></asp:Label>
                            <asp:DropDownList ID="ddlSelectVendor" runat="server">
                                <asp:ListItem Value="0">Select Vendor Name...</asp:ListItem>
                            </asp:DropDownList>
                            <asp:Button ID="btnSelectVendor" runat="server" Text="Select Vendor" OnClick="btnSelectVendor_Click"
                                Style="margin-left: 15px; height: 35px;" />
                            <fieldset style="margin: 5px;">
                                <legend>Vendor Info</legend>
                                <asp:HiddenField ID="hfVendorID" runat="server" Value="" />
                                <asp:Label ID="lblMVendorName" CssClass="labels" Width="60px" Font-Bold="true" Font-Size="12px" Text="Name:" runat="server" />
                                <asp:TextBox ID="txtMVendorName" Enabled="false" runat="server" MaxLength="50" />
                                <br />
                                <asp:Label ID="lblMVendorAddress" CssClass="labels" Width="60px" Font-Bold="true" Font-Size="12px" Text="Address:" runat="server" />
                                <asp:TextBox ID="txtMVendorAddress" Enabled="false" runat="server" MaxLength="50" />
                                <br />
                                <asp:Label ID="lblMVendorPhone" CssClass="labels" Width="60px" Font-Bold="true" Font-Size="12px" Text="Phone:" runat="server" />
                                <asp:TextBox ID="txtMVendorPhone" Enabled="false" runat="server" MaxLength="25" />
                                <br />
                                <asp:Label ID="lblVendorStatus" CssClass="labels" Width="60px" Font-Bold="true" Font-Size="12px" Text="Status:" runat="server" />
                                <asp:DropDownList ID="ddlVendorStatuses" Enabled="false" runat="server">
                                </asp:DropDownList>
                            </fieldset>
                            <asp:Button ID="btnSubmitChanges" runat="server" Enabled="false" Text="Submit Changes"
                                OnClick="btnSubmitChanges_Click" />
                            <br />
                        </fieldset>
                    </ContentTemplate>
                </asp:TabPanel>
                <asp:TabPanel ID="TabPanel6" runat="server" HeaderText="TabPanel2">
                    <HeaderTemplate>Add/Edit Adjustment Reason</HeaderTemplate>
                    <ContentTemplate>
                        <fieldset style="width: 537px">
                            <asp:MultiView ID="mvItemAdjustments" runat="server" ActiveViewIndex="0">
                                <asp:View ID="vAddItemAdjustment" runat="server">
                                    <fieldset>
                                        <legend>Add Reason</legend>
                                        <table style="width: 100%;">
                                            <tr>
                                                <th class="style5">
                                                    <asp:Label ID="lblAddAdjusment" Width="90px" runat="server" Text="Adjustment Reason:"></asp:Label>
                                                </th>
                                                <td>
                                                    <asp:TextBox ID="txtAdjusmentReason" runat="server"></asp:TextBox>
                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                                                        ControlToValidate="txtAdjusmentReason" ErrorMessage="Reason is required" 
                                                        ForeColor="Red" ValidationGroup="AdjustmentAdd"></asp:RequiredFieldValidator>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td></td>
                                                <td>
                                                    <asp:Button ID="btnAddAdjustReason" runat="server" OnClick="btnAddAdjustReason_Click"
                                                        Text="Add" ValidationGroup="AdjustmentAdd" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td colspan="3">
                                                    <asp:Label ID="lblAddReasonSuccess" runat="server" BackColor="#CFE2C6"></asp:Label>
                                                </td>
                                            </tr>
                                        </table>
                                    </fieldset>
                                    <fieldset>
                                        <legend>Edit Reason</legend>
                                        <table style="width: 100%;">
                                            <tr>
                                                <th class="style5">
                                                    <asp:Label ID="Label3" Width="90px" runat="server" Text="Adjustment Reason:"></asp:Label>
                                                </th>
                                                <td>
                                                    <asp:DropDownList ID="ddlModifyAdjustReason" runat="server" OnSelectedIndexChanged="ddlModifyAdjustReason_Changed" AutoPostBack="True"></asp:DropDownList>
                                                    <asp:CompareValidator ID="cvModAdjustReason" runat="server" ErrorMessage="Select a reason"
                                                        ControlToValidate="ddlModifyAdjustReason" ValidationGroup="AdjustmentEdit" Type="Integer" 
                                                        ValueToCompare="0" Operator="GreaterThan" ForeColor="Red"></asp:CompareValidator>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th class="style5">
                                                    <asp:Label ID="Label10" Width="90px" runat="server" Text="New Reason:"></asp:Label>
                                                </th>
                                                <td>
                                                    <asp:TextBox ID="txtModAdjustReason" runat="server"></asp:TextBox>
                                                    <asp:RequiredFieldValidator ID="rfvModAdjustReason" runat="server" 
                                                        ControlToValidate="txtModAdjustReason" ErrorMessage="Reason is required" 
                                                        ForeColor="Red" ValidationGroup="AdjustmentEdit"></asp:RequiredFieldValidator>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td></td>
                                                <td>
                                                    <asp:Button ID="btnEditAdjustReason" runat="server" OnClick="btnEditAdjustReason_Click"
                                                        Text="Save" ValidationGroup="AdjustmentEdit" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td colspan="3">
                                                    <asp:Label ID="lblEditReasonSuccess" BackColor="#CFE2C6" runat="server"></asp:Label>
                                                </td>
                                            </tr>
                                        </table>
                                    </fieldset>
                                </asp:View>
                            </asp:MultiView>
                        </fieldset>
                    </ContentTemplate>
                </asp:TabPanel>
                <asp:TabPanel runat="server" HeaderText="TabPanel5" ID="TabPanel7" ScrollBars="Auto">
                    <HeaderTemplate>
                        Add/Edit Item Category</HeaderTemplate>
                    <ContentTemplate>
                        <asp:Label ID="lblAddCategorySuccess" runat="server" Font-Bold="True" ForeColor="Green" BackColor="#CFE2C6"></asp:Label>
                        <br />
                        <asp:Label ID="lblAddCategoryError" runat="server" Font-Bold="True" ForeColor="Red"></asp:Label>
                        <br />
                        <fieldset>
                            <legend>Add Item Category</legend>
                            <table>
                                <tr>
                                    <td>
                                        <asp:Label ID="lblCategoryName" CssClass="labels" Width="109px" Font-Bold="true" Font-Size="12px" runat="server">Category Name:</asp:Label>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtCategoryName" runat="server" MaxLength="99"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtCategoryName"
                                            ErrorMessage="Category name is required" ForeColor="Red" ValidationGroup="addCategory">*</asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label ID="Label4" CssClass="labels" Width="109px" Font-Bold="true" Font-Size="12px" runat="server">Store to carry this category:</asp:Label>
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="ddlCreateCatCntrlStore" runat="server"></asp:DropDownList>
                                        <asp:CompareValidator ID="CompareValidator5" runat="server" ErrorMessage="Which store carries this category?"
                                            ControlToValidate="ddlCreateCatCntrlStore" ValidationGroup="addCategory" Type="Integer" 
                                            ValueToCompare="0" Operator="GreaterThan" ForeColor="Red"></asp:CompareValidator>
                                    </td>
                                </tr>
                            </table>
                            <asp:Button ID="btnAddCategory" runat="server" Text="Add Category" OnClick="btnAddCategory_Click" ValidationGroup="addCategory"/>
                            <br />
                        </fieldset>
                        <fieldset>
                            <legend>Modify Item Category</legend>
                            <table>
                                <tr>
                                    <td>
                                        <asp:Label ID="Label1" CssClass="labels" Width="109px" Font-Bold="true" Font-Size="12px" runat="server">Category to Modify:</asp:Label>
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="ddlModifyCategory" runat="server" OnSelectedIndexChanged="ddlModifyCategory_Changed" AutoPostBack="True"></asp:DropDownList>
                                        <asp:CompareValidator ID="CompareValidator1" runat="server" ErrorMessage="Select a category"
                                            ControlToValidate="ddlModifyCategory" ValidationGroup="modifyCategory" Type="Integer" 
                                            ValueToCompare="0" Operator="GreaterThan" ForeColor="Red"></asp:CompareValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label ID="lblModifyCategoryName" CssClass="labels" Width="109px" Font-Bold="true" Font-Size="12px" runat="server">New Name:</asp:Label>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtModifyCategoryName" runat="server" MaxLength="99"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtModifyCategoryName"
                                            ErrorMessage="Category name is required" ForeColor="Red" ValidationGroup="modifyCategory">*</asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label ID="Label5" CssClass="labels" Width="109px" Font-Bold="true" Font-Size="12px" runat="server">Store to carry this category:</asp:Label>
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="ddlModCatCntrlStore" runat="server"></asp:DropDownList>
                                        <asp:CompareValidator ID="CompareValidator3" runat="server" ErrorMessage="Which store carries this category?"
                                            ControlToValidate="ddlModCatCntrlStore" ValidationGroup="modifyCategory" Type="Integer" 
                                            ValueToCompare="0" Operator="GreaterThan" ForeColor="Red"></asp:CompareValidator>
                                    </td>
                                </tr>
                            </table>
                            <asp:Button ID="btnModifyCategory" runat="server" Text="Modify Category" OnClick="btnModifyCategory_Click" ValidationGroup="modifyCategory"/>
                            <br />
                        </fieldset>
                    </ContentTemplate>
                </asp:TabPanel>
                <asp:TabPanel runat="server" HeaderText="TabPanel5" ID="TabPanel5" ScrollBars="Auto" Visible="false">
                    <HeaderTemplate>
                        Add Purchased Item</HeaderTemplate>
                    <ContentTemplate>
                        <asp:Label ID="lblVendorItemSuccess" runat="server" Font-Bold="True" ForeColor="Green" BackColor="#CFE2C6"></asp:Label>
                        <br />
                        <asp:Label ID="lblVendorItemError" runat="server" Font-Bold="True" ForeColor="Red"></asp:Label>
                        <br />
                        <fieldset>
                            <legend>Add Purchased Item</legend>
                            <fieldset style="margin: 5px;">
                                <legend>Purchased Item Info</legend>
                                <asp:Label ID="lblSelectItem" Style="margin-right: 19px;" runat="server" Text="Select Item:" />
                                <asp:DropDownList ID="ddlItems" runat="server">
                                    <asp:ListItem Value="0">Select Item...</asp:ListItem>
                                </asp:DropDownList>
                                <br />
                                <asp:Label ID="lblVendor" Style="margin-right: 3px;" runat="server" Text="Select Vendor:" />
                                <asp:DropDownList ID="ddlVendors" runat="server">
                                    <asp:ListItem Value="0">Select Vendor...</asp:ListItem>
                                </asp:DropDownList>
                                <br />
                                <asp:Label ID="lblVendorCost" Style="margin-right: 66px;" Text="Cost:" runat="server" />
                                <asp:TextBox ID="txtVendorCost" runat="server" />
                                <br />
                                <asp:Label ID="lblPurchaseDate" Text="Purchase Date:" runat="server" />
                                <asp:TextBox ID="txtPurchaseDate" runat="server" MaxLength="10" />
                                <asp:CalendarExtender ID="cePurchaseDate" runat="server" TargetControlID="txtPurchaseDate">
                                </asp:CalendarExtender>
                                <br />
                                <asp:Label ID="lblVItemQuantity" Style="margin-right: 39px;" Text="Quantity:" runat="server" />
                                <asp:TextBox ID="txtVItemQuantity" runat="server" />
                            </fieldset>
                            <asp:Button ID="btnSavePruchasedItem" runat="server" Text="Save" OnClick="btnSavePurchasedItem_Click" />
                            <br />
                        </fieldset>
                    </ContentTemplate>
                </asp:TabPanel>
            </asp:TabContainer>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
